package net.user.action;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.user.db.board.BoardDataBean;
import net.user.db.board.BoardDBBean;

public class UpdateProAction implements Action {

    public ActionForward execute( HttpServletRequest request,
        HttpServletResponse response) throws Exception {

        request.setCharacterEncoding("euc-kr");

        String pageNum = request.getParameter("pageNum");

	BoardDataBean article = new BoardDataBean();
        article.setNum(Integer.parseInt(request.getParameter("num")));
        article.setWriter(request.getParameter("writer"));
        article.setEmail(request.getParameter("email"));
        article.setSubject(request.getParameter("subject"));
        article.setContent(request.getParameter("content"));
        article.setPasswd(request.getParameter("passwd"));
   
	BoardDBBean dbPro = BoardDBBean.getInstance();
        int check = dbPro.updateArticle(article);

        request.setAttribute("pageNum", new Integer(pageNum));
        request.setAttribute("check", new Integer(check));

        ActionForward forward=new ActionForward();
       forward.setRedirect(false);
       forward.setPath("/user/board/updatePro.jsp");
     
       
       return forward;
	}
}